package com.atguigu.spzx.common.exception;

import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import lombok.Data;

@Data
public class GuiguException extends RuntimeException{
    private Integer code; // 错误状态码
    private String message; // 错误状态信息

    private ResultCodeEnum resultCodeEnum ;     // 封装错误状态码和错误消息


    public GuiguException(ResultCodeEnum resultCodeEnum) {
        this.resultCodeEnum = resultCodeEnum;
        this.code = resultCodeEnum.getCode();
    }

    public GuiguException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

}
